package com.family.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.family.mapper.FUserMapper;
import com.family.model.FamilyUser;
import com.family.service.FUserService;

@Service
public class FUserServiceImpl implements FUserService {
	@Autowired
	private FUserMapper userDao;
	@Override
	public List<FamilyUser> getList() {
		return userDao.getList();
	}
	@Override
	public void saveOrUpdate(FamilyUser user) {
		if(user.getId() == null) {
			userDao.add(user);
		}else {
			userDao.update(user);
		}
	}
	@Override
	public FamilyUser findById(Integer id) {
		return userDao.findById(id);
	}
	@Override
	public Integer getByUserAndPassword(String account, String password) {
		return userDao.getByUserAndPassword(account, password);
	}

}
